using System;
using System.Collections;
using System.Web.UI;

namespace PHSRAG.Insight21.Common
{
	/// <summary>
	/// sets
	/// </summary>
	public class PageContextAgent
	{
		public static void PassContext(Page p, Hashtable ht)
		{
			foreach (string key in ht.Keys)
			{
				p.ClientScript.RegisterHiddenField(String.Format("PageContext_{0}",key),ht[key].ToString());
			}
		}
		public static Hashtable GetContext(Page p)
		{
			Hashtable ht = new Hashtable();

			foreach (string key in p.Request.Form.Keys)
			{
				if (key.StartsWith("PageContext_"))
				{
					ht[key] = p.Request.Form[key];
				}
			}
		    return  ht;
		}
	}
}